package com.example.springbootjackson.traceId;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

@ApiModel(
    value = "Request",
    description = "Request对象"
)
public class Request<T> {
    @ApiModelProperty("Request header对象")
    private Request.Header header = new Request.Header();
    @ApiModelProperty("业务入参对象")
    protected T model;

    public Request() {
    }

    public Request.Header getHeader() {
        return this.header;
    }

    public void setHeader(Request.Header header) {
        this.header = header;
    }

    public T getModel() {
        return this.model;
    }

    public void setModel(T model) {
        this.model = model;
    }


    @ApiModel(
        value = "Request Header",
        description = "Request Header"
    )
    @Data
    public static class Header implements Serializable {
        @ApiModelProperty("accessToken")
        private String accessToken;
        @ApiModelProperty("是否展示所有")
        private Boolean viewAll;
        @ApiModelProperty("用户ID")
        private Long xUserId;
        @ApiModelProperty("用户名")
        private String xUserName;
        @ApiModelProperty("xBPId")
        private String xBPId;
        @ApiModelProperty("语言")
        private String xLangCode;
        @ApiModelProperty("系统环境语言")
        private String xSystemLangCode;
        @ApiModelProperty("调用方app id")
        private String xAppId;
        @ApiModelProperty("初始来源调用方app id")
        private String xSourceAppId;
        @ApiModelProperty("客户端IP")
        private String xClientIp;
        @ApiModelProperty("开放ID")
        private String xOpenId;
        @ApiModelProperty("开放平台")
        private Integer xOpenPlatform;
        @ApiModelProperty("平台id")
        private Integer xPlatformId;
        @ApiModelProperty("租户id")
        private Long xTenantId;
        @ApiModelProperty("前端请求的唯一id")
        private String guid;
        @ApiModelProperty("设备ID")
        private String xDeviceId;
        @ApiModelProperty("xToken")
        private String xToken;
        @ApiModelProperty("xIsTest")
        private Boolean xIsTest;
        @ApiModelProperty("xTestFlag")
        private String xTestFlag;
        @ApiModelProperty("调用链")
        private String xTraceId;
        @ApiModelProperty("调用方请求ID")
        private String xCallerId;
        @ApiModelProperty("Js指纹")
        private String xJsFinger;
        @ApiModelProperty("登录的Seesion")
        private String xSession;
        @ApiModelProperty("app推送token")
        private String xPushToken;
        @ApiModelProperty("调用Java接口连接超时时间")
        private Integer xConnectTimeoutMillis = 0;
        @ApiModelProperty("调用Java接口请求超时时间")
        private Integer xReadTimeoutMillis = 0;
        @ApiModelProperty("扩展字段")
        private Map<String, Object> ext = new HashMap();

    }
}
